import 'osc_notice.dart';
import 'osc_relative.dart';

class OscNewsDetailEntity_1 {
	String author;
	int id;//新闻编号
	int authorId;
	String title;//新闻标题
	String body;//新闻内容（HTML）
	String pubDate;//发布日期
	int favorite;//是否收藏 1-收藏 0-未收藏
	String url;//新闻原地址
	List<OscRelative> relatives;
	int commentCount;//评论数
	OscNotice notice;

	OscNewsDetailEntity_1({this.author, this.id, this.authorId, this.title, this.body, this.pubDate, this.favorite, this.url, this.relatives, this.commentCount, this.notice});

	OscNewsDetailEntity_1.fromJson(Map<String, dynamic> json) {
		author = json['author'];
		id = json['id'];
		authorId = json['authorid'];
		title = json['title'];
		body = json['body'];
		pubDate = json['pubDate'];
		favorite = json['favorite'];
		url = json['url'];
		if (json['relativies'] != null) {
			relatives = new List<OscRelative>();(json['relativies'] as List).forEach((v) { relatives.add(new OscRelative.fromJson(v)); });
		}
		commentCount = json['commentCount'];
		notice = json['notice'] != null ? new OscNotice.fromJson(json['notice']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['author'] = this.author;
		data['id'] = this.id;
		data['authorid'] = this.authorId;
		data['title'] = this.title;
		data['body'] = this.body;
		data['pubDate'] = this.pubDate;
		data['favorite'] = this.favorite;
		data['url'] = this.url;
		if (this.relatives != null) {
      data['relativies'] =  this.relatives.map((v) => v.toJson()).toList();
    }
		data['commentCount'] = this.commentCount;
		if (this.notice != null) {
      data['notice'] = this.notice.toJson();
    }
		return data;
	}
}

